package com.jonluo.controller;

import com.jonluo.entity.UserEntity;
import org.apache.shiro.SecurityUtils;

/**
 * Controller公共组件
 * @author com.jonluo
 * Date 2017/9/15
 */
public abstract class AbstractController {
	//获取当前登录用户
	protected UserEntity getCurrentUser() {
		return (UserEntity) SecurityUtils.getSubject().getPrincipal();
	}
	//获取当前登录用户id
	protected String getCurrentUserId() {return getCurrentUser().getUserId();}
	//获取当前登录用户部门id
	protected String getCurrentDeptId() {
		return getCurrentUser().getDeptId();
	}
}
